#ifndef WIDGET_H
#define WIDGET_H

#include "gif.h"
#include "pacman.h"
#include <QTimer>
#include <QWidget>

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void paintEvent(QPaintEvent *e) override;
    void keyPressEvent(QKeyEvent *e) override;

private:
    Pacman *hero;
    QList<Enemy*> enemies;
    QList<Food*> foods;

    QTimer heroTimer;

    Gif g;
    Gif::GifWriter writer;
    int frames;
    int fIdx;
    uint8_t *imgData;
};
#endif // WIDGET_H
